/*
 * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

package org.opendaylight.netconf.test.tool.monitoring;

import java.util.Collections;
import java.util.Set;
import org.opendaylight.netconf.api.capability.Capability;
import org.opendaylight.netconf.api.monitoring.CapabilityListener;
import org.opendaylight.netconf.mapping.api.NetconfOperationService;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;

public class NetconfMonitoringOperationServiceFactory implements NetconfOperationServiceFactory,
        AutoCloseable {

    private final NetconfMonitoringOperationService operationService;

    private static final AutoCloseable AUTO_CLOSEABLE = () -> {
        // NOOP
    };

    public NetconfMonitoringOperationServiceFactory(final NetconfMonitoringOperationService operationService) {
        this.operationService = operationService;
    }

    @Override
    public NetconfOperationService createService(final String netconfSessionIdForReporting) {
        return operationService;
    }

    @Override
    public Set<Capability> getCapabilities() {
        return Collections.emptySet();
    }

    @Override
    public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
        return AUTO_CLOSEABLE;
    }

    @Override
    public void close() {
    }
}

